import { postRequest, getRequest } from '@/utils/request.js';


export const loginApi = {
  /**
   * 小程序端登录
   */
  loginByCode: (param) => {
    return postRequest('/sys/user/auth/loginByCode', param);
  },
  /**
   * H5端登录
   */
  loginByUnionId: (param) => {
    return postRequest('/sys/user/auth/loginByUnionId', param);
  },
  /**
   * 小程序端根据code获取用户信息
   */
  getUserInfoByCode: (param) => {
    return postRequest('/sys/user/auth/getUserInfoByCode', param);
  },
  /**
   * H5端获取用户信息
   */
  getUserInfoByUnionId: (param) => {
    return postRequest('/sys/user/auth/getUserInfoByUnionId', param);
  },
  /**
   * 获取登录信息
   */
  getInfo: () => {
    return getRequest('/sys/user/auth/getLoginInfo');
  },
  
  updateUserInfo: (param) => {
    return postRequest('/sys/user/auth/updateUserInfo', param);
  },
  
  getUserInfoByMobile: (mobile) => {
    return getRequest('/sys/user/auth/getUserInfoByMobile',mobile);
  },
  
};